<!-- 住院史 -->
<#if docData.zhuYuanSList??>
    <#list docData.zhuYuanSList as item>
        <entry>
            <encounter classCode="ENC" moodCode="EVN">
                <code displayName="住院史"/>
                <effectiveTime>
                    <low value="${item.ruYuanSJ!''}"/>
                    <high value="${item.chuYuanSJ!''}"/>
                </effectiveTime>
                <performer>
                    <assignedEntity>
                        <id/>
                        <representedOrganization>
                            <name>${item.yiLiaoJGMC!''}</name>
                        </representedOrganization>
                    </assignedEntity>
                </performer>
                <#if item.cengZhuYBAHList??>
                    <#list item.cengZhuYBAHList as cengZhuYBAH>
                        <entryRelationship typeCode="COMP">
                            <observation classCode="OBS" moodCode="EVN">
                                <code code="DE01.00.004.00" displayName="曾住院病案号" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"/>
                                <#--                        <value xsi:type="INT"/>-->
                                <value xsi:type="INT" value="${cengZhuYBAH!''}"/>
                            </observation>
                        </entryRelationship>
                    </#list>
                </#if>

                <#if item.zhuYuanYYList??>
                    <#list item.zhuYuanYYList as zhuYuanYY>
                        <entryRelationship typeCode="RSON">
                            <observation classCode="OBS" moodCode="EVN">
                                <code code="DE05.10.053.00" displayName="住院原因" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"/>
                                <value xsi:type="ST">${zhuYuanYY!''}</value>
                            </observation>
                        </entryRelationship>
                    </#list>
                </#if>
            </encounter>
        </entry>
    </#list>
</#if>


<!-- 家庭病床史 -->
<#if docData.bingChuangSList??>
    <#list docData.bingChuangSList as item>
        <entry>
            <encounter classCode="ENC" moodCode="EVN">
                <code displayName="家庭病床史"/>
                <effectiveTime>
                    <low value="${item.jianChuangRQ!''}"/>
                    <high value="${item.cheChuangRQ!''}"/>
                </effectiveTime>
                <performer>
                    <assignedEntity>
                        <id/>
                        <representedOrganization>
                            <name>${item.yiLiaoJGMC!''}</name>
                        </representedOrganization>
                    </assignedEntity>
                </performer>
                <entryRelationship typeCode="COMP">
                    <observation classCode="OBS" moodCode="EVN">
                        <code code="DE01.00.004.00" displayName="曾建立家庭病床病案号" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"/>
                        <value xsi:type="INT" value="${item.cengBingCBAH!''}"/>
                    </observation>
                </entryRelationship>
                <entryRelationship typeCode="RSON">
                    <observation classCode="OBS" moodCode="EVN">
                        <code code="DE06.00.047.00" displayName="家庭病床建立原因" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"/>
                        <value xsi:type="ST">${item.bingChuangJLYY!''}</value>
                    </observation>
                </entryRelationship>
            </encounter>
        </entry>
    </#list>
</#if>
